FROM alpine:latest
RUN echo "https://mirror.tuna.tsinghua.edu.cn/alpine/v3.4/main/" > /etc/apk/repositories
RUN apk update \
&& apk upgrade \
&& apk add --no-cache curl unzip \
   bash \
   bash-doc \
   bash-completion \
&& cd /bin && rm -f sh && ln -s /bin/bash sh \
&& rm -rf /var/cache/apk/*
ADD file/rclone-current-linux-amd64.zip /opt/
RUN unzip /opt/rclone-current-linux-amd64.zip \
&& cd rclone-*-linux-amd64 \
&& cp rclone /usr/bin/ \
&& chmod 755 /usr/bin/rclone \
&& rm -rf /opt/rclone-current-linux-amd64.zip \
&& rm -rf rclone-*-linux-amd64
ADD file/rclone.conf /root/.config/rclone/
ADD script/cos_rclone.sh /usr/local/bin/
ENTRYPOINT ["sh"]
CMD ["/usr/local/bin/cos_rclone.sh"]
